import requests
def face_analyze(face_tokens):
    """该函数为调用Face++ face_analyze接口"""
    base_url = 'https://api-cn.faceplusplus.com/facepp/v3/face/analyze'
#     files = {'image_file': (image_path, open(image_path, 'rb'), 'multipart/form-data')}
    payload = {
            'api_key':"Vf1TVr0kb7C0wavMhpaKym9OSkwGRNaw",
            'api_secret':"POyLi052sYdsVnEe-Gs27AxP9fqd7zHJ",
            'face_tokens':face_tokens,
            "return_landmark":2,
            "return_attributes":'gender,age,smiling,glass,headpose,blur,eyestatus,emotion,facequality,beauty,mouthstatus,eyegaze,skinstatus'
            }
    

    r = requests.post(base_url, params = payload)
    return r.json()
